<!--
  @author mujunlin
  @since 2019/10/17 16:34
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<table class="layui-hide" id="zmn-table" lay-filter="zmn-table" th:fragment="table">
    <thead>
    <tr>
        <th lay-data="{type:'checkbox',field:'weightId', width:50, unresize:true, align:'center', fixed:'left'}"></th>
        <th lay-data="{field:'configId', width:50, unresize:true, align:'center', fixed:'left', hide:true}">ID</th>
        <th lay-data="{field:'plat', width:100, unresize:true, align:'center'}">服务平台</th>
        <th lay-data="{field:'companyName', width:230, unresize:true, align:'center'}">服务商</th>
        <th lay-data="{field:'cityName', width:80, unresize:true, align:'center'}">城市</th>
        <th lay-data="{field:'robOrderStatus', width:100, unresize:true, align:'center'}">抢单状态</th>
        <th lay-data="{field:'robOrderTimeStr',  unresize:true, align:'center'}">抢单时间段</th>
        <th lay-data="{field:'newSimpleStatus', width:100, unresize:true, align:'center'}">新单简单派单</th>
        <th lay-data="{field:'autoStatusNew', width:120, unresize:true, align:'center'}">新单自动派单</th>
        <th lay-data="{field:'autoStatusRework', width:120, unresize:true, align:'center'}">返修自动派单</th>
        <th lay-data="{field:'autoTimeStart', width:100, unresize:true, align:'center'}">自动派单时间</th>
        <th lay-data="{field:'reworkLimit', width:100, unresize:true, align:'center'}">最大返修单量</th>
        <th lay-data="{field:'distanceWeight', unresize:true, align:'center'}">新单派单权重</th>
        <th lay-data="{field:'true', unresize:true, align:'center', width:80, fixed:'right', toolbar: '#tableBar'}">操作</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="item:${items}">
        <td th:text="${item.weightId}"></td>
        <td th:text="${item.configId}"></td>
        <td th:switch="${item.plat}">
            <div th:each="plat:${platList}"
                 th:text="${plat.value}"
                 th:if="${item.plat == plat.key}">
            </div>
        </td>
        <td th:text="${item.companyName}"></td>
        <td th:text="${item.cityName}"></td>
        <td>
            <input th:id="${item.configId}" type="checkbox" name="robOrderStatus" lay-skin="switch" lay-text="ON|OFF" lay-filter="changeRobOrderStatus" th:checked="${item.robOrderStatus==2}">
        </td>
        <td>
            <span th:each="relation:${item.robOrderRelationList}" th:text="
                    ${relation.robOrderTimeStart}+'~'+${relation.robOrderTimeEnd}+'  '
            "/>
        </td>
        <td th:switch="${item.newSimpleStatus}" style="height: 20px;line-height: 20px;">
            <div th:each="status:${normalStatusSet}">
                <span
                        th:case="${status.getCode()}"
                        th:text="${status.getName()}"
                        th:class="${T(com.zmn.oms.common.constant.ConfOrderEnum.StatusEnum).STATUS_FORBIDDEN.getCode() == status.getCode()?'layui-badge layui-bg-gray' : 'layui-badge layui-bg-green'}"
                        style="height: 20px;line-height: 20px;">
                </span>
            </div>
        </td>
        <td th:switch="${item.autoStatusNew}">
            <div th:each="autoStatus:${autoStatusSet}">
                <span
                        th:case="${autoStatus.getCode()}"
                        th:text="${autoStatus.getName()}"
                        th:class="${T(com.zmn.oms.common.constant.ConfOrderEnum.AutoStatusEnum).AUTO_STATUS_FORBIDDEN.getCode() == autoStatus.getCode()?'layui-badge layui-bg-gray' : 'layui-badge layui-bg-green'}"
                        style="height: 20px;line-height: 20px;">
                </span>
            </div>
        </td>
        <td th:switch="${item.autoStatusRework}">
            <div th:each="reworkStatus:${reworkStatusSet}">
                <span
                        th:case="${reworkStatus.getCode()}"
                        th:text="${reworkStatus.getName()}"
                        th:class="${T(com.zmn.oms.common.constant.ConfOrderEnum.ReworkStatusEnum).REWORK_STATUS_FORBIDDEN.getCode() == reworkStatus.getCode()?'layui-badge layui-bg-gray' : 'layui-badge layui-bg-green'}"
                        style="height: 20px;line-height: 20px;">
                </span>
            </div>
        </td>
        <td th:text="${item.autoTimeStart + ' ~ ' + item.autoTimeEnd}"></td>
        <td th:text="${item.reworkLimit}"></td>
        <td>
            <p th:each="relation:${item.distributeWeightRelationList}" th:text="
                    ${relation.weightType == null} ? '' : ${relation.weightType == 1 ? '直营工程师权重(': '非直营工程师权重(' } +
                    '距离：' + ${relation.distanceWeight == null ? '' : relation.distanceWeight} +
                    '% 手头单：' + ${relation.handlerWeight == null ? '' : relation.handlerWeight} +
                    '% 新单派单量：' + ${relation.distributeNewCount == null ? '' : relation.distributeNewCount} +
                    '% 星级分：' + ${relation.starLevelScoreWeight == null ? '' : relation.starLevelScoreWeight} +
                    '% 服务分：' + ${relation.serveScore == null ? '' : relation.serveScore} +
                    '% 单时比：' + ${relation.datumOrderHourRatio == null ? '' : relation.datumOrderHourRatio} + '%)'+
                    '% 虚假改派分：' + 100 + '%)'+
                    '% 虚假取消分：' + 100 + '%)'
            "/>
        </td>
        <td></td>
    </tr>
    </tbody>
</table>